package org.ouwh.oowiki.http;

import java.util.Iterator;

import javax.servlet.http.HttpServletRequest;

import org.ouwh.oowiki.GlobalConstants;

public class HttpRequestParser {

	public MyRequest parse(HttpServletRequest request) throws Exception {
		request.setCharacterEncoding(GlobalConstants.CHAR_SET);

		MyRequest myRequest = new MyRequest(request);
		Iterator<?> it = request.getParameterMap().keySet().iterator();
		while (it.hasNext()) {
			String name = (String) it.next();
			String value = request.getParameter(name);
			myRequest.putParameter(name, value);
		}
		return myRequest;
	}

}
